from dotenv import load_dotenv
import os

# 加载 .env 文件
load_dotenv()

# 从环境变量中获取 API 密钥
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
os.environ["OPENAI_API_BASE"] = os.getenv("OPENAI_API_BASE")
os.environ["TAVILY_API_KEY"] = os.getenv("TAVILY_API_KEY")

# main.py
from fastapi import FastAPI
from api.research_report import router  # 导入抽离出来的路由模块


app = FastAPI()
# 将路由注册到FastAPI应用中
app.include_router(router)

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)
